package net.csdn.business.common.constant;

/**
 * @author likun
 * @date 2022/6/6 18:34
 */
public class CommonConstants {
    public static final String TRUE = "true";

    /**
     * 命名空间验证正则表达式
     */
    public static final String NAME_SPACE_REGEX = "^(?!-)[a-zA-Z0-9_\\-]+(?<!\\.|\\.git)$";

    public static final String TRACE_ID = "traceId";

    public static final String TRACE_IP = "TRACE_IP";

    public static final String FIELD_TRACE_ID = "traceid";
    public static final String FIELD_EAGLEEYE_TRACEID = "eagleeye-traceid";

    public static final String FIELD_UID = "uid";
    public static final String FIELD_ASSIGN_USER = "assignUser";
    public static final String FIELD_PROJECT_ID = "projectId";

    /**
     * 防重提交 redis key
     */
    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";

    public static final String TEXT_UNKNOWN = "unknown";

    public static String COMMA = ",";
    public static String COLON = ":";
    public static String SLASH = "/";
    public static String POUND = "#";
    public static String UNDERLINE = "_";
    public static String BLACK = "";
    public static String UTF_8 = "utf-8";
    public static String UTF8 = "UTF8";
    public static String MD5 = "MD5";

    public static final int INT_ZERO = 0;
    public static final int INT_ONE = 1;
    public static final int INT_NEGATIVE_ONE = -1;
    public static final int INT_EIGHT = 8;
    public static final int INT_TEN = 10;
    public static final int INT_TWENTY = 20;
    public static final int INT_THIRTY = 30;
    public static final int ONE_HUNDRED = 100;

    public static final long LONG_ZERO = 0L;

    public static final double DOUBLE_ZERO = 0d;
    public static final double DOUBLE_ONE = 1.0;

    public static final String HEADER_TOKEN_EXTERNAL_NO_FILL = "External-no-fill";
    public static final String HEADER_TOKEN_EXTERNAL_AK = "External-Ak";
    public static final String HEADER_TOKEN_EXTERNAL_TOKEN = "External-token";

    public static final String UPLOAD_PATH = "uploads/";
    public static final String UPLOAD_PATH_USER = "uploads/user/";

    public static final String SETTINGS = "settings";
    public static final String SUFFIX_GIT = ".git";
    public static final String PREFIX_GIT = "git@";
    public static final String PREFIX_HTTPS = "https://";

    public static final String CONTENT_TYPE_EXCEL = "application/vnd.ms-excel;charset=utf-8";

    public static final int ASYNC_DELAY_MS = 5000;

    /**
     * 项目搜索默认排序
     */
    public static final String PROJECT_DEFAULT_ORDER = "last_activity_at";
    public static final String PROJECT_ORDER_STAR_COUNT = "star_count";

    public static final int NOTIFY_CONTENT_SIZE = 100;
    /**
     * 邮箱推送相关:每个模板单一的code
     */
    public static final String joinRepOrOrgInvitation = "joinRepOrOrgInvitation";
    public static final String invitationSuccess = "invitationSuccess";
    public static final String invitationFail = "invitationFail";
    public static final String abnormalLogin = "abnormalLogin";
    public static final String userDestroy = "userDestroy";
    public static final String userRegisterSuccess = "userRegisterSuccess";
    public static final String sshKeyAddition = "sshKeyAddition";
    public static final String issueAdd = "issueAdd";
    public static final String issueCloseWithComment = "issueCloseWithComment";
    public static final String issueCloseNoneComment = "issueCloseNoneComment";
    public static final String issueMention = "issueMention";
    public static final String issueNewComment = "issueNewComment";
    public static final String issueMove = "issueMove";
    public static final String issuePrincipalChange = "issuePrincipalChange";
    public static final String issuePrincipalChangeToNobody = "issuePrincipalChangeToNobody";
    public static final String issueStatusChange = "issueStatusChange";
    public static final String deleteOrg = "deleteOrg";
    public static final String aliTemplate = "aliTemplate";
    public static final String auditCommentNotPass = "auditCommentNotPass";
    public static final String auditNotPass = "auditNotPass";
    public static final String auditReportNotPass = "auditReportNotPass";
    public static final String auditReportPassForReporter = "auditReportPassForReporter";
    public static final String auditReportPassForOwner = "auditReportPassForOwner";
    public static final String issuePrincipalChangeToFirstPerson = "issuePrincipalChangeToFirstPerson";
    public static final String ISSUE_COMMENT_AT = "issueCommentAt";
    /**
     * 组织关联相关模板
     */
    public static final String ORG_RELATION_INVITATION = "OrgReleationInvitation";
    public static final String ORG_RELATION_INVITATION_PASS = "OrgReleationInvitationPass";
    public static final String ORG_RELATION_INVITATION_REJECT = "OrgReleationInvitationReject";
    public static final String SUB_ORG_QUIT_PARENT_ORG = "SubOrgQuitParentOrg";

    /**
     * discuss相关模板
     */
    public static final String DISCUSS_COMMENT_AT = "discussCommentAt";


    /**
     * CLA协议检查
     */
    public static final String CHECK_DESC_CLA_NOT_FOUND = "未关联到CLA协议";
    public static final String CHECK_DESC_CLA_STATUS_OFF = "关联的CLA协议处于未启用状态";
    // public static final String CHECK_DESC_CLA_MR_CHECK_OFF = "关联的CLA协议未开启MR检查";
    // public static final String CHECK_DESC_CLA_ORG_CHECK_OFF = "组织内成员且未启用组织成员CLA检查";
    public static final String CHECK_DESC_CLA_SIGN_VALID = "已签署协议,且生效中";
    public static final String CHECK_DESC_CLA_SIGN_INVALID = "未签署协议或已过期";

    public static final String CLA_UN_SIGN_TEMPLATE = "<a href='#{[userProfile]}'>@#{[username]}</a>，欢迎向 <a href='#{[repoUrl]}'>#{[repo]}</a> 代码库贡献代码，我们目前尚未查找到您账号（邮箱：<code>#{[mail]}</code>）签署的贡献者协议文件（CLA），请在代码被合入前完成 CLA 协议的签署。\n\n" +
            "<blockquote><a href='#{[signAddr]}'>点击签署 #{[claName]}.（#{[claVersion]}）</a></blockquote>";

    public static final String CLA_SIGN_TEMPLATE = "<a href='#{[userProfile]}'>@#{[username]}</a>，您的 CLA 已经签署完成并生效，点击查看<a href='#{[signAddr]}'>已签署 CLA 协议</a>。";

    /**
     * 待签署地址（准备签署地址）
     */
    public static final String CLA_SIGN_ADDR = "/cla/agreement/%s/sign";

    /**
     * 已经签署过(个人设置已签署）
     */
    public static final String CLA_SIGNED_ADDR = "/-/profile/clas";

    public static final String PULL_REQUEST_ADDR = "/%s/change/%d";

    /**
     * 日期格式化配置
     */
    public static final String DEFAULT_PATTERN = "yyyy-MM-dd'T'HH:mm:ssXXX";
    public static final String DEFAULT_TIMEZONE = "GMT+8";


    /**
     * 通知中心相关业务编码-start
     */


    //邀请用户加入组织通知业务编码
    public static final String ORG_INVITE_JOIN = "org_invite_join";
    //用户接受邀请加入组织的通知业务编码
    public static final String ORG_INVITE_ACCEPT = "org_invite_accept";
    //用户拒绝邀请加入组织的通知业务编码
    public static final String ORG_INVITE_REFUSE = "org_invite_refuse";
    //组织删除
    public static final String ORG_DEL = "org_del";
    //用户注销账号通知编码
    public static final String USER_LOG_OFF = "user_log_off";
    //用户异常登录通知编码
    public static final String USER_ABNORMAL_LOGIN = "user_abnormal_login";


    //ISSUE创建
    public static final String ISSUE_CREATE ="issue_create";
    //ISSUE评论
    public static final String ISSUE_COMMENT ="issue_comment";

    //ISSUE提到
    public static final String ISSUE_REFERER ="issue_referer";
    //ISSUE状态变更
    public static final String ISSUE_UPDATE_STATE ="issue_update_state";
    //ISSUE状态变更,带评论
    public static final String ISSUE_UPDATE_STATE_COMMENT ="issue_update_state_comment";
    //ISSUE负责人变更
    public static final String ISSUE_ASSIGN ="issue_assign";





    //邀请用户加入仓库通知业务编码
    public static final String PROJECT_INVITE_JOIN = "project_invite_join";
    //用户接受邀请加入仓库的通知业务编码
    public static final String PROJECT_INVITE_ACCEPT = "project_invite_accept";
    //用户拒绝邀请加入仓库的通知业务编码
    public static final String PROJECT_INVITE_REFUSE = "project_invite_refuse";
    //用户添加ssh_key，发送通知
    public static final String USER_ADD_SSH_KEY = "user_add_sshkey";
    //组织关联申请，发送通知
    public static final String ORG_INVITE_RELATION = "org_relation_invite";
    //接受关联申请，发送通知
    public static final String ORG_RELATION_ACCEPT = "org_relation_accept";
    //拒绝关联申请，发送通知
    public static final String ORG_RELATION_REFUSE = "org_relation_refuse";
    //退出组织关联申请，发送通知
    public static final String ORG_QUIT_RELATION = "org_quit_relation";
    //用户通过邀请链接申请加入组织或仓库，给管理员发送通知
    public static final String INVITE_LINK_APPLY = "invite_link_apply";
    //用户通过邀请链接加入组织或仓库，给管理员发送通知
    public static final String INVITE_LINK_JOIN = "invite_link_join";
    //管理员审核用户通过邀请链接申请加入组织或仓库结果，给申请用户发送审核结果通知
    public static final String INVITE_LINK_AUDIT = "invite_link_audit";

    //企业认证相关业务通知
    //企业认证申请通知
    public static final String ENTERPRISE_AUTH_APPLY = "enterprise_auth_apply";
    //企业认证审核通知
    public static final String ENTERPRISE_AUTH_AUDIT_PASS = "enterprise_auth_audit_pass";
    public static final String ENTERPRISE_AUTH_AUDIT_REFUSE= "enterprise_auth_audit_refuse";
    //企业认证申请超时未审核通知
    public static final String ENTERPRISE_AUTH_OVERTIME = "enterprise_auth_overtime";

    /**
     * 通知中心相关业务编码-end
     */
}